package day15;

import java.util.Stack;

public class StckDemo {
    public static void main(String[] args) {

        //peek获取但是不移除
        //pop获取并移除
        Stack<String> stack = new Stack<>();
        stack.push("a");
        stack.push("o");
        stack.push("e");
        stack.push("b");
        stack.push("f");
        System.out.println(stack.empty());
        System.out.println(stack.peek());
//        System.out.println(stack);
//        System.out.println(stack.pop());
        System.out.println(stack);
        //从栈顶向栈底查找元素,从1开始
        System.out.println(stack.search("b"));
    }
}
